import $service from '../../../../../../service'
const app = getApp()
Component({
  properties: {
    isFee: {
      type: Boolean,
      value: false
    },
    preId: {
      value: ''
    },
    no: {
      value: ''
    },
    ishospitalPre: {
      value: ''
    }
  },
  data: {
    text: '<p>这是一个温馨提示</p>'
  },
  lifetimes: {
    attached() {
      this.querLetterOfConsent()
    }
  },
  methods: {
    querLetterOfConsent() {
      app.http.querLetterOfConsent().then(res => {
        this.setData({
          text: res.data.initKey
        })
      }).catch(err => {
        $service.showToast(err.msg)
      })
    },
    closeBox() {
      this.setData({
        isFee: false
      })
    },
    sure() {
      wx.navigateTo({
        url: '/pages/prescription_flow/order_create/order_create?prescription_id=' + this.properties.preId + '&prescriptionNo=' + this.properties.no + '&ishospitalPre=' + this.properties.ishospitalPre
      })
    }
  } 
})
